﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cspl.AnimalFight.Lib.Interface;
using Cspl.AnimalFight.Lib.EventHandlers;

namespace Cspl.AnimalFight.Lib.Data
{
    class Snake:AnimalBase,IAttack,IDefense
    {
        public event AttackDelegate AttackEvent;
        public event DefendEventHandler DefentEvent;

        public void Attack(EventHandlers.Animals target)
        {
            if (AttackEvent != null) {
                AttackEventHandler e = new AttackEventHandler
                {
                    AnimalName = this.AnimalName,
                    AttackPower = this.AttackPower,
                    Target = target
                };
            }
        }



        public bool IsDefending
        {
            get;
            set;
        }

        public void Defend()
        {
            if (DefentEvent != null) {
                DefentEvent(this, new DefenseEventHandler{
                    AnimalName = this.AnimalName,
                    Target = Animals.Snake
                });
            }
        }
    }
}
